<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/view/common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
    <%@ include file="/WEB-INF/view/common/css_js_ace.jsp" %>
    <script type="text/javascript">
    
    $(function(){
    	$('.tipMe').tooltip({'placement':'top'});
    });
    
        function changeRecvSyscode(recvNode) {
            var svalue = $(recvNode).val();
            if (svalue == null || svalue == "") {
                $("#recvSyscode option[value!='']").remove();
                return;
            }
            var url = _ctx + "/monitor/get_sysinfo_nodecode.do";
            $.selectCascade(recvNode, url, "recvSyscode", "sysCode", "sysName", "nodecode");
        }
        function changeSendSyscode(sendNode) {
            var svalue = $(sendNode).val();
            if(svalue==null||svalue==""){
                $("#sendSyscode option[value!='']").remove();
                return;
            }
            var url =_ctx + "/monitor/get_sysinfo_nodecode.do";
            $.selectCascade(sendNode,url,"sendSyscode","sysCode","sysName","nodecode");
        }


        function search(form) {
            $(form).appendPagerParaStr();
            return true;
        }

        function deleteById(id) {
            ui.confirm('确认删除?', function () {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    cache: false,
                    url: _ctx + "/monitor/send_file_data_delete.do",
                    data: {id: id},
                    success: function (resp) {
                        if (resp.status == '1') {
                            ui.msg(resp.msg, 1);
                            ui.go(_ctx + '/monitor/send_file_data_list.do');
                        } else {
                            ui.msg(resp.msg, 0);
                        }
                    },
                    error: function () {
                        ui.msg('信息加载错误', 0);
                    }
                });
            });
        }


        /**
         * 批量删除
         */
        function deleteByBatch() {
            var ids = $("input[name='ids']:checked");//jquery语法，选择页面中所有input表单中name=ids且被选中的值
            if (ids.length == 0) {
                ui.msg('请至少选择一条要删除的记录');
                return;
            }
            var idsVal = "";
            for (var i = 0; i < ids.length; i++) {
                idsVal += $(ids[i]).val() + ",";
            }
            idsVal = idsVal.substring(0, idsVal.length - 1);
            ui.confirm('确认删除选中的记录?', function () {
                $.ajax({
                    type: "POST",
                    dataType: "json",
                    cache: false,
                    url: _ctx + "/monitor/send_file_data_deletes.do",
                    data: {"ids": idsVal},
                    success: function (resp) {
                        if (resp.status == '1') {
                            ui.msg(resp.msg, 1);
                            ui.go(_ctx + '/monitor/send_file_data_list.do');
                        } else {
                            ui.msg(resp.msg, 0);
                        }
                    },
                    error: function () {
                        ui.msg('信息加载错误', 0);
                    }
                });
            });
        }

        /* function detail(id){
         ui.box({
         title:'详细信息',
         size: 'lg',   //sm , lg
         remote:_ctx +'/monitor/send_file_data_get.do',
         param:{id:id}
         });
         } */
    </script>
</head>
<body>
<%@ include file="/WEB-INF/view/common/topbar.jsp" %>
<div class="main-container" id="main-container">
<div class="main-container-inner">
<%@ include file="/WEB-INF/view/common/sidebar.jsp" %>
<div class="main-content">
<div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="#">首页</a>
        </li>
        <li>
			<a href="#">数据交换监控</a>
		</li>
		<li>
			<a href="#">非结构化数据监控</a>
		</li>
        <li class="active">发送数据监控</li>
    </ul>
</div>

<div class="page-content">
    <div class="row">
        <div class="col-xs-12">

            <div class="widget-box">
                <div class="widget-header header-color-white">
                    <div class="widget-toolbar no-border">
                        <a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="deleteByBatch()"><i
                                class="icon-trash icon-on-right"></i> 批量删除&nbsp;</a>
                        <a href="#" data-action="collapse">
                            <i class="icon-chevron-up"></i>
                        </a>
                    </div>
                </div>

                <div class="widget-body">
                    <div class="widget-main">
                        <form id="searchForm" class="form-search" action="${ctx}/monitor/send_file_data_list.do"
                              method="post" onsubmit="return search(this)">
                            <div class="row">
                                <div class="col-xs-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">发送节点</span>
                                        <%-- <input class="form-control" type="text" name="sendNodecode" value="${param.sendNodecode}"/> --%>
										<c:if test="${isSysUser}">
										 <select class="form-control form-select" name="sendNodecode" disabled="disabled">
												<option value="">全部</option>
												<c:forEach var="map" items="${send_node_list }">
												<option value="${map.code}" <c:if test="${map.code == localNode.nodeCode }">selected</c:if>>${map.name}</option>
												</c:forEach>
										   </select>
										</c:if>
										<c:if test="${!isSysUser}">
										   <select class="form-control form-select" name="sendNodecode">
												<option value="">全部</option>
												<c:forEach var="map" items="${send_node_list }">
												<option value="${map.code}" <c:if test="${map.code == param.sendNodecode }">selected</c:if>>${map.name}</option>
												</c:forEach>
										   </select>
										</c:if>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">发送适配器</span>
										<c:if test="${isSysUser }">
											<select class="form-control form-select" name="sendAdaptercode" disabled="disabled">
											<option value="">全部</option>
											    <c:forEach var="map" items="${send_adapter_list }">
												<option value="${map.code}" <c:if test="${map.code == _user_session.userName}">selected</c:if>>${map.name}</option>
												</c:forEach>
											</select>
										</c:if>
											<c:if test="${!isSysUser }">
											   	<select class="form-control form-select" name="sendAdaptercode">
											<option value="">全部</option>
												<c:forEach var="map" items="${send_adapter_list }">
												<option value="${map.code}" <c:if test="${map.code == param.sendAdaptercode}">selected</c:if>>${map.name}</option>
												</c:forEach>
												</select>
											</c:if>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">发送状态</span>
                                        <select class="form-control form-select" name="sendStatus">
                                            <option value="">全部</option>
                                            <c:forEach var="vo" items="${send_status_list }">
                                                <option value="${vo.status}"
                                                        <c:if test="${vo.status == param.sendStatus }">selected</c:if>>${vo.desc}</option>
                                            </c:forEach>
                                        </select>

                                    </div>
                                </div>
                            </div>

                            <div class="row mg-top12">
                                <div class="col-xs-4">
									<div class="input-group">
										<span class="input-group-addon">接收节点</span>
										<select class="form-control form-select" name="recvNodecode">
											<option value="">全部</option>
											<c:forEach var="map" items="${recv_node_list }">
											<option value="${map.code}" <c:if test="${map.code == param.recvNodecode && map.code!=null}">selected</c:if>>${map.name}</option>
											</c:forEach>
										</select>
									</div>
								</div>
                                 <div class="col-xs-4">
												<div class="input-group">
													<span class="input-group-addon">通知状态</span>
													<select class="form-control form-select" name="notifyStatus">
														<option value="">全部</option>
														<c:forEach var="vo" items="${notify_status_list}">
														<option value="${vo.status}" <c:if test="${vo.status == param.notifyStatus }">selected</c:if>>${vo.desc}</option>
														</c:forEach>
													</select>
												</div>
											</div>
                            </div>
                            <div class="row mg-top12">
                                <div class="col-xs-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">开始时间</span>
													<span class="input-icon input-icon-right width-100">
													<input type="text" class="input-cal" id="startCreated"
                                                           name="startCreated" value="${param.startCreated}"
                                                           onfocus="WdatePicker({onpicked:function(){endCreated.focus();},dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true,maxDate:'#F{$dp.$D(\'endCreated\');}'})"
                                                           style=""/>
													<i class="icon-calendar blue pointer"
                                                       onclick="javascript:$('#startCreated').focus();"></i>
													</span>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">结束时间</span>
													<span class="input-icon input-icon-right width-100">
													<input type="text" class="input-cal" id="endCreated"
                                                           name="endCreated" value="${param.endCreated}"
                                                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowWeek:true, minDate:'#F{$dp.$D(\'startCreated\');}'})"/>
													<i class="icon-calendar blue pointer"
                                                       onclick="javascript:$('#endCreated').focus();"></i>
													</span>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <div class="input-group">
													<span class="input-group-btn">
														<button type="submit" class="btn btn-purple btn-sm">
                                                            <i class="icon-search icon-on-right bigger-110"></i>
                                                            搜索
                                                        </button>&nbsp;&nbsp;
														<a href="${ctx}/monitor/send_file_data_list.do"
                                                           class="btn btn-purple btn-sm">
                                                            <i class="icon-refresh icon-on-right bigger-110"></i>
                                                            清空
                                                        </a>
													</span>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

            <div class="hr hr12 hr-dotted"></div>
							<div class="pull-left">
								<p><span class="badge badge-info"> <i class="icon-info-sign"></i>  路由图例说明 </span>&nbsp;&nbsp;&nbsp;&nbsp;
								<span class=""><span  title="适配器"  class="tipMe fa fa-puzzle-piece"></span>&nbsp;适配器</span>&nbsp;&nbsp;&nbsp;&nbsp;
								<span class=""><span  title="节点"  class="tipMe icon-desktop"></span>&nbsp;节点</span>&nbsp;&nbsp;&nbsp;&nbsp;
								<span class=""><span  title="刻盘"  class="tipMe fa fa-cloud-download"></span>&nbsp;刻盘</span>&nbsp;&nbsp;&nbsp;&nbsp;
								<span class=""><span  title="网闸"  class="tipMe fa fa fa-shield"></span>&nbsp;网闸</span>&nbsp;&nbsp;&nbsp;&nbsp;
								<span class=""><span  title="路线指向"  class="tipMe icon-arrow-right"></span>&nbsp;路线指向</span></p>
							</div>
							<div class="pull-right" style="padding-bottom: 10px;"><a href="#" title="刷新" class="tipMe btn btn-xs btn-info" onclick="javascript:$.refresh();">
														<i class="icon-refresh"></i>刷新
													</a></div>
						<div class="table-responsive clearfix">
							<table id="sample-table-1" class="table table-striped table-bordered table-hover">
								<thead>
									<tr>

										<th class="center">
											<label>
											<input type="checkbox" class="ace" name="cka" onclick="$.checkBoxTriggerAll(this,'ids')"/>
											<span class="lbl"></span>
											</label>
										</th>
										<th style="white-space: nowrap;">数据类型</th>
                                        <th _orderCloumnName="send_nodecode" style="white-space: nowrap;">路由</th>

										<th style="white-space: nowrap;">发送状态</th>
										<th _orderCloumnName="created" style="white-space: nowrap;">发送时间</th>
										<th style="white-space: nowrap;">更新时间</th>
										<th style="white-space: nowrap;">本级交换</th>
										<th style="white-space: nowrap;">跨网交换</th>
										<th style="white-space: nowrap;">操作</th>
									</tr>
								</thead>

								<tbody>
									<c:forEach var="vo" items="${_data}">
									<tr>
										<th class="center">
                                            <label>
                                                <input type="checkbox" class="ace" name="ids" value="${vo.orderId}" />
                                                <span class="lbl"></span>
											</label>
										</th>
										<td><span title="${si:dataName(vo.sendBusicode) }">${si:dataName(vo.sendBusicode) }</span></td>
                                        <td class="left">
                                                  <span  title="发送适配器"  class="tipMe fa fa-puzzle-piece">&nbsp;${si:adaptorName(vo.sendAdaptorcode)}</span>
												  <span class="icon-arrow-right"></span>
												  <span  class="tipMe icon-desktop" title="发送节点">&nbsp;${si:nodeName(vo.sendNodecode)}</span>
												  <span class="icon-arrow-right"></span>
												   <c:if test="${vo.crossNode=='0' && vo.crossNet=='0' }">
												  <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
												  <c:if test="${vo.crossNode=='1' && vo.crossNet=='0' }">
												   <span  class="tipMe icon-desktop" title="接收节点">&nbsp;${si:nodeName(vo.recvNodecode)}</span>
												   <span class="icon-arrow-right"></span>
												   <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
												   <c:if test="${vo.crossNet=='2' && vo.throughGap!='2' }">
												   <c:if test="${vo.sendNodecode!= vo.outGapNodeCode}">
												       <span  class="tipMe icon-desktop" title="网闸节点">&nbsp;${si:nodeName(vo.outGapNodeCode)}</span>
												       <span class="icon-arrow-right"></span>
												   </c:if>
												   <span  class="tipMe fa fa fa-shield" title="网闸">单向网闸&nbsp;</span>
												   <span class="icon-arrow-right"></span>
												    <span  class="tipMe icon-desktop" title="接收节点">&nbsp;${si:nodeName(vo.recvNodecode)}</span>
												     <span class="icon-arrow-right"></span>
												   <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
												  <c:if test="${vo.crossNet=='2' && vo.throughGap=='2' }">
												      <c:if test="${vo.sendNodecode!= vo.outGapNodeCode}">
												       <span  class="tipMe icon-desktop" title="网闸节点">&nbsp;${si:nodeName(vo.outGapNodeCode)}</span>
												       <span class="icon-arrow-right"></span>
												      </c:if>
												      <span  class="tipMe fa fa-cloud-download" title="刻盘">&nbsp;刻盘</span>
												       <span class="icon-arrow-right"></span>
												       <span  class="tipMe icon-desktop" title="刻盘上传节点">&nbsp;${si:nodeName(vo.innerGapNodeCode)}</span>
												       <span class="icon-arrow-right"></span>
												       <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
												  <c:if test="${vo.crossNet=='1' }">
												   <span  class="tipMe fa fa-cloud-download" title="刻盘">&nbsp;刻盘</span>
												  </c:if>
												  
												  	  <c:if test="${!si:isInnerNet(netType) && vo.crossNet=='1' && vo.crossNode=='1' }">
												      <span class="icon-arrow-right"></span>
												       <span  class="tipMe icon-desktop" title="刻盘上传节点">&nbsp;${si:nodeName(vo.outGapNodeCode)}</span>
												       <span class="icon-arrow-right"></span>
												        <span  class="tipMe icon-desktop" title="接收节点">&nbsp;${si:nodeName(vo.recvNodecode)}</span>
												   <span class="icon-arrow-right"></span>
												   <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
												  <c:if test="${!si:isInnerNet(netType) && vo.crossNet=='1' && vo.crossNode=='0' }">
												       <span class="icon-arrow-right"></span>
												       <span  class="tipMe icon-desktop" title="刻盘上传节点">&nbsp;${si:nodeName(vo.outGapNodeCode)}</span>
												       <span class="icon-arrow-right"></span>
												       <span  class="tipMe fa fa-puzzle-piece" title="接收适配器">&nbsp;${si:adaptorName(vo.recvAdaptorcode)}</span>
												  </c:if>
                                        </td>
                                        <td>${si:sendStatus(vo.sendStatus)}
                                           <c:if test="${ vo.crossNet=='0'}">
                                           (${si:notifyStatus(vo.notifyStatus) })
                                           </c:if>
                                        </td>
										<td>${si:fmtDate(vo.created)}</td>
										<td>${si:fmtDate(vo.modified)}</td>
										<td>
											<c:if test="${'1' == vo.crossNode }">否</c:if>
											<c:if test="${'0' == vo.crossNode }">是</c:if>
											&nbsp;
										</td>
										<td>
										  <c:if test="${vo.crossNet=='2' }">
										     ${si:YN('1')}
										  </c:if>
										  <c:if test="${vo.crossNet!='2' }">${si:YN(vo.crossNet)}</c:if>
										</td>
									   <td>
		                                <div class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
		                                    <a class="blue" href="${ctx}/monitor/send_file_data_get.do?id=${vo.orderId}"
		                                       title="查看">
		                                        <i class="icon-zoom-in bigger-130"></i>
		                                    </a>
		                                    <a class="red" href="javascript:void(0)" onclick="deleteById('${vo.orderId}');"
		                                       title="删除">
		                                        <i class="icon-trash bigger-130"></i>
		                                    </a>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <jsp:include page="/WEB-INF/view/common/pg.jsp">
                    <jsp:param value="${ctx}/monitor/send_file_data_list.do" name="url"/>
                    <jsp:param value="${_total}" name="total"/>
                    <jsp:param value="${_urlpara}" name="urlpara"/>
                </jsp:include>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript">

var isSysUser=${isSysUser};
if(isSysUser){
	//alert("${localNode.id}");
	$("select[name='sendNodecode']").val("${localNode.nodeCode}");
}
</script>
</html>
